package com.bsoft.ecommerce.coverter;

import com.bsoft.ecommerce.constant.BrandCategory;

import javax.persistence.AttributeConverter;

public class BrandCategoreConverter  implements AttributeConverter<BrandCategory,String> {
    @Override
    public String convertToDatabaseColumn(BrandCategory brandCategory) {
        return brandCategory.getCode();
    }

    @Override
    public BrandCategory convertToEntityAttribute(String s) {
        return BrandCategory.of(s);
    }
}
